﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TelerikMvcApplicationASPX.Models.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

 <style type="text/css">
        .error { color: Red; margin: 0 0 0 5px; }
        
        #field-list
        {
            display: inline-block; *display: inline; zoom: 1;
            overflow: hidden;
        }
        
        #field-list li
        {
            list-style-type: none;
            padding-bottom: 5px;
        }
        
        #field-list label
        {
            display: inline-block; *display: inline; zoom: 1;
            width: 120px; text-align: right; padding-right: 5px;
            vertical-align: top;
            padding-top: 2px;
        }
        
        #field-list input,
        #field-list textarea
        {
            font: normal 12px Tahoma;
            width: 130px;
        }
        
        #field-list button
        {
            margin: 19px 0 0 205px;
            width: 60px;
        }
    </style>

<h2>Create</h2>
<% Html.Telerik().ScriptRegistrar()
                     .DefaultGroup(group => group
                         .Add("MicrosoftAjax.js")
                         .Add("MicrosoftMvcValidation.js")); %>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>UserModel</legend>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.UserName) %>
        </div>
        <div id="field-list">
            <%: Html.EditorFor(model => model.UserName) %>
            <span class="error"><%: Html.ValidationMessageFor(model => model.UserName) %></span>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Role) %>
        </div>
        <div class="editor-field">
            <%= Html.Telerik().ComboBox()
                .Name("ComboBox").BindTo(new SelectList(ViewBag.Roles, "IdRole", "RoleName"))
            %>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
<% } %>

<div>
    <%: Html.ActionLink("Back to List", "Index") %>
</div>

</asp:Content>

